home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD School House 10
/
CD School House - Education and Games (10.0) - Wayzata Technology (1995).iso
/
mac
/
DOS
/
MISC
/
SSTUFF30
/
STUFF.DOC
< prev
next >
Wrap
Text File
|
1994-05-16
|
126KB
|
3,246 lines
STEENBURGH'S STUFF
Mildly Useful Utilities
For Batch Files
Version 3.01
Copyright 1991-1994 Chuck Steenburgh & Tay-Jee Software
_______
____|__ | (TM)
--| | |-------------------
| ____|__ | Association of
| | |_| Shareware
|__| o | Professionals
-----| | |---------------------
|___|___| MEMBER
Page 1
TABLE OF CONTENTS
Introduction. . . . . . . . . . . . . . 4
Definition of Shareware . . . . . . . . . . 6
Disclaimer - Agreement . . . . . . . . . . 6
ASP Ombudsman . . . . . . . . . . . . . 8
BATBOX. . . . . . . . . . . . . . . . 9
BOX. . . . . . . . . . . . . . . . . 14
CHKDRV. . . . . . . . . . . . . . . . 17
CHKPRN. . . . . . . . . . . . . . . . 19
CHKSYS. . . . . . . . . . . . . . . . 20
CLK. . . . . . . . . . . . . . . . . 22
CURSOR. . . . . . . . . . . . . . . . 25
DOSVER. . . . . . . . . . . . . . . . 26
INPUT . . . . . . . . . . . . . . . . 27
KLS. . . . . . . . . . . . . . . . . 34
LAUNCHER . . . . . . . . . . . . . . . 37
MUSIC . . . . . . . . . . . . . . . . 41
RAND . . . . . . . . . . . . . . . . 43
SIFT . . . . . . . . . . . . . . . . 44
SKIP . . . . . . . . . . . . . . . . 46
SOUNDER . . . . . . . . . . . . . . . 47
SPACE . . . . . . . . . . . . . . . . 49
WAITFOR . . . . . . . . . . . . . . . 51
WHENISIT . . . . . . . . . . . . . . . 52
Page 2
WRITE . . . . . . . . . . . . . . . . 55
XD . . . . . . . . . . . . . . . . . 58
Page 3
INTRODUCTION
Practically everyone who owns a PC has written a batch
file at one time or another. Batch files can give even the
novice user powerful tools to manage and control his or her
computer. While the capabilities of batch files have slow-
ly improved through successive releases of MS-DOS, there
are real limits on what you are capable of with batch files.
Some of the biggest complaints about batch files:
- Lack of interactive features
- Poor screen/speaker output capabilities
- SLOW!
- Inability to to access certain types of system info
Over the years, many batch file "compiler" languages
have appeared on the scene. Interested in greater speed
and power for my batch files, I evaluated several of the
shareware versions of these utilities. Unfortunately,
they only seemed to be as hard (if not harder) than learn-
ing a completely new programming language. Sometimes,
these systems wouldn't even compile "plain" batch files
that I was using without any special commands!
Having struck out with the batch file compilers, I
then started collecting miscellaneous utilities to try
to expand my batch file capability piecemeal. While there
are many excellent programs available, they generally
have drawbacks of one kind or another. Some programs are
tiny (less than 1K) .COM files that are speedy but don't
do enough and have very limited options. There are other
programs that are more capable, but bigger and slower and
usually involving several zillion command line switches to
get anything useful out of the program.
Frustrated, I decided to start writing my own set of
utilities. Over several months' time, these utilities de-
veloped into the collection I call "STEENBURGH's STUFF:
Mildly Useful Utilities." These programs are listed below:
BATBOX: Simple menu creation/input system
BOX: Place boxes on the screen
CHKDRV: Drive status reporting utility
Page 4
CHKPRN: Check parallel printer status
CHKSYS: Report device driver/TSR status
CLK: Displays time/date on screen
CURSOR: Change cursor shape
DOSVER: Checks for DOS version
INPUT: Advanced prompt/input system
KLS: Colorful screen-clearing utility
LAUNCHER: File selection/execution system
MUSIC: Plays transcribed sheet music on the PC
RAND: Random number generator
SIFT: Multi-purpose DOS filter
SKIP: Prints blank lines from batch files
SOUNDER: Wide range of noise making options
SPACE: File/disk space reporting utility
WAITFOR: Timed pauses
WHENISIT: Date/time telling utility
WRITE: Colorful output anywhere on screen
XD: Create/switch directories at the same time
As much as possible, I have tried to compromise between
program size on the one hand (keeping them small and fast)
and features on the other. As you will see, many of the
programs are under 15K, and none is over 45K. While this
is considerably larger than some assembly language programs
(I have a program that prints individual blank lines from
batch files that is only 12 bytes!), the entire collection
takes up very little disk space. This is less than just
the documentation for some larger utilities.
The size of these programs is due to their being compiled
in 'C'. However, these programs are FAST, for several rea-
sons. First, they were compiled with the Power C compiler
from Mix Software. Power C may not be the most capable of
compilers, but it is probably the fastest DOS compiler around
overall. Second, these programs leave out some of the "cute"
features that other programs include that slow them down con-
siderably. For example, when you run "MUSIC" you'll hear
sounds all right, but no animated cherubs will perform aero-
batics while the music plays. When you run SPACE, you will
not see an aquarium filled with swimming fish representing
the number of occupied bytes of disk space. And, (I can't
resist), NO FLYING TOASTERS. Instead, you will get concise,
neat information on the screen, in most cases accompanied by
an errorlevel which can be evaluated by your batch files.
Page 5
DEFINITION OF SHAREWARE
Shareware distribution gives users a chance to try software
before buying it. If you try a Shareware program and continue
using it, you are expected to register. Individual programs
differ on details -- some request registration while others
require it, some specify a maximum trial period. With
registration, you get anything from the simple right to continue
using the software to an updated program with printed manual.
Copyright laws apply to both Shareware and commercial software,
and the copyright holder retains all rights, with a few specific
exceptions as stated below. Shareware authors are accomplished
programmers, just like commercial authors, and the programs are
of comparable quality. (In both cases, there are good programs
and bad ones!) The main difference is in the method of
distribution. The author specifically grants the right to copy
and distribute the software, either to all and sundry or to a
specific group. For example, some authors require written
permission before a commercial disk vendor may copy their
Shareware.
Shareware is a distribution method, not a type of software. You
should find software that suits your needs and pocketbook,
whether it's commercial or Shareware. The Shareware system makes
fitting your needs easier, because you can try before you buy.
And because the overhead is low, prices are low also. Shareware
has the ultimate money-back guarantee -- if you don't use the
product, you don't pay for it.
DISCLAIMER - AGREEMENT
Users of STEENBURGH's STUFF must accept this disclaimer of war-
ranty:
"STEENBURGH's STUFF is supplied as is. The author disclaims all
warranties, expressed or implied, including, without limitation,
the warranties of merchantability and of fitness for any pur-
pose. The author assumes no liability for damages, direct or
consequential, which may result from the use of STEENBURGH'S
STUFF." However, Tay-Jee Software will replace a DEFECTIVE
diskette at ANY time. Simply return the original, DEFECTIVE
diskette and we'll send you a new one for a nominal replacement
fee (currently $2) to cover the cost of replacement.
STEENBURGH's STUFF is a "shareware program" and is provided at
no charge to the user for evaluation. Feel free to share it
Page 6
with your friends, but please do not give it away altered or
as part of another system. The essence of "user-supported"
software is to provide personal computer users with quality
software without high prices, and yet to provide incentive
for programmers to continue to develop new products. If you
find this program useful and find that you are using STEEN-
BURGH'S STUFF and continue to use STEENBURGH's STUFF after a
reasonable trial period, you must make a registration payment
of $19.95/$29.95 to Tay-Jee Software. The registration fee will
license one copy for use on any one computer at any one time.
You must treat this software just like a book. An example is
that this software may be used by any number of people and may
be freely moved from one computer location to another, so long
as there is no possibility of it being used at one location
while it's being used at another. Just as a book cannot be
read by two different persons at the same time.
Users have two registration options: BASIC ($19.95) and DELUXE
($29.95). BASIC registration includes a copy of the latest,
registered versions of the utilities on disk. DELUXE registra-
tion also includes the latest versions, plus laser printed
documentation on mylar-reinforced sheets enclosed in a plastic
binder. DELUXE registration also incldues free documentation
upgrades when the user upgrades to a later version of STEEN-
BURGH's STUFF.
To register, print out the file REGISTER.FRM, fill it out,
and mail to the address on the form. If the form is missing,
send your name & address, name of the program being registered,
preferred disk size, and check in U.S. funds for the appropriate
amount to: Tay-Jee Software, P.O. Box 835, Lexington, VA 24450.
(VA residents must add 4.5(null)ales tax and customers outside
North America must add $5 for shipping.) You may also register
on-line on CompuServe by typing GO SWREG and registering under
ID# 1170 (Basic) or #1217 (Deluxe). Finally, you may send
credit card info via Email to CompuServe 72330,1776, INTERNET
TayJeeSoft@aol.com, America On-Line TayJeeSoft, or by calling
(800)378-3966 or (703)261-7023.
Commercial users of STEENBURGH's STUFF must register and pay
for their copies of STEENBURGH's STUFF within 30 days of first
use or their license is withdrawn. Site-License arrangements
may be made by contacting Tay-Jee Software.
Anyone distributing STEENBURGH's STUFF for any kind of remun-
eration should refer to the file VENDOR.DOC in the accompany-
ing package/archive for further information.
Page 7
You are encouraged to pass a copy of STEENBURGH's STUFF along
to your friends for evaluation. Please encourage them to
register their copy if they find that they can use it. All
registered users will receive a copy of the latest version of
the STEENBURGH's STUFF system.
ASP OMBUDSMAN
This program is produced by a member of the Association of
Shareware Professionals (ASP). ASP wants to make sure that
the shareware principle works for you. If you are unable to
resolve a shareware-related problem with an ASP member by
contacting the member directly, ASP may be able to help. The
ASP Ombudsman can help you resolve a dispute or problem with
an ASP member, but does not provide technical support for
members' products. Please write to the ASP Ombudsman at 545
Grover Road, Muskegon, MI 49442 or send a CompuServe message
via CompuServe Mail to ASP Ombudsman, 70007,3536.
Page 8
INDIVIDUAL PROGRAM DESCRIPTIONS
========== ======= ============
BATBOX.EXE 2.7 |
Copyright 1991-1993 by Chuck Steenburgh and Tay-Jee Software
People have been creating menus with batch files for
years. Some of these are quite elaborate, others very crude.
BATBOX is something in between. BATBOX will allow you to
display an attractive, colorful menu and will wait for
the user to make a selection. It will then set an appro-
priate ERRORLEVEL value which can be used to determine sub-
sequent actions in your batch file.
Usage: BATBOX menufile [/C] [/Dn] [/Tn] [/M] [/Wn] [/H] |
[/O] [/Q] [/Pn]
menufile is the name of an ASCII text
file which you create. This
will contain the menu's title
and a list of options.
/C Normally, the longest menu item
is centered in the menu box and
subsequent items are left-aligned
below it. This switch will cause
each menu item to be centered in
the menu box.
/Dn Date format. Current valid values
for n are:
1 YY.MM.DD
2 Short month (DD Mmm YY)
3 Weekday (Www MM DD)
- Turn off date display
/Tn Time format. Valid values for n are:
1 Display time using 12-hour
clock with AM/PM
2 24-hour clock, no seconds
3 12-hour clock, no seconds
/M Set BATBOX master environment variable|
equal to menu item selected. |
Page 9
/Wn Exit menu if no keys are pressed with-
in n seconds and return errorlevel of
255.
/H Generates help screen.
/O Ordinal menu selection. Instead
of returning an errorlevel based
on the hotkey, returns an error-
level based on the ordinal pos-
ition of the selected menu item.
/Q Quiet mode suppresses all sounds.
/Pn Select predefined color palettes:
1 - Ice Blue
2 - Fire Red
3 - Pastel
4 - Monochrome
5 - LCD 1 (B/W) |
6 - LCD 2 (W/B) |
To create a menufile, use a text editor, word processor that
can save ASCII files, or EDLIN.COM or EDIT.COM that come with
DOS. In a pinch, you can use the "copy con" command but this
doesn't give you much in the way of an editing capability.
The structure of the menufile is simple. The first line
contains your menu's title, up to 60 characters. If you
don't want a title, leave the line blank, without any spaces.
(Hint: press RETURN immediately without doing anything else
when you first begin editing your document.) Each succes-
sive line contains a menu item, exactly as you want it to ap-
pear on the screen. Do NOT include any blank lines here or
you will end up with blank lines in your menu!
A few limitations: each line can contain no more than 60
characters (if you need more than this to describe your menu
choices, maybe you need Microsoft Windows, a Macintosh, or
something else with lots of pictures!). In addition, your menu
items (but NOT the menu title) should each begin with a dis-
tinct letter in order for the selection function to work pro-
perly. The selection function for BATBOX is case-insensitive,
so if you begin one line with the letter 's' and the other
with the letter 'S', these are considered the same. Up to
10 menu items are permitted in any one file.
Page 10
By default, BATBOX treats the first letter of each menu item |
as a "hot key" which can be used to select that item. If for |
some reason you prefer to use a letter other than the first as |
a "hot key," insert the "@" character immediately before the |
desired hot key. The "@" character will NOT appear on the menu.|
When you type BATBOX on the command line followed by the
name of your menufile (they must both be in the current dir-
ectory), you will see a menu pop up in the middle of the
screen. The title will appear at the top, with each of your
menu items (up to ten) appearing at double spaced-intervals
inside the menu box. Each item will also be numbered from 1
to 0 (the 10th item being numbered "0"). At the bottom of the
menu you will see a the message "Enter your menu choice: ".
If you have a color monitor, you will notice that the first
letter (the "hot key") of each menu item appears in a different |
color than the rest of the text (unless you have specified a |
different letter as the "hot key"; see above). The time and |
date will also be displayed at the top of the menu. |
There are now three separate methods of selecting a menu
item. The first is by pressing the hotkey described above.
The second is by pressing the item number displayed to the left
of each menu item (1-0, with 0 representing item 10). The
third method, new since Version 2.5, is by positioning the cur-
sor bar over the appropriate menu item and pressing ENTER. Use
the up/down cursor arrow keys to move the bar up and down. You
may also use the PgUp key to position the bar over the first
menu item and the PgDn key to position it over the last menu
item. PRESSING ANY OTHER KEY will produce an error tone (un-
less the /Q switch is specified) but otherwise do nothing.
After selecting a menu item in one of the ways above, BATBOX
will then exit, and return an errorlevel based on the hotkey.
See Appendix 1 for a list of legal first letters and the error-
levels that are returned by BATBOX. If you select the /O op-
tion, BATBOX will return the position of the selected menu item
via the errorlevel. For example, if you select the 1st item on
the list and have specified /O, the errorlevel will be set to
1. If you select the 5th item, the errorlevel will be 5, and
so on. You can use the errorlevel value that is returned to
branch to different parts of your batch file or to execute
commands. See the DEMO.BAT file for an example of one way to
do this. (DEMO.BAT is part of the STUF??.ZIP archive which
contains demonstration files for all of the STEENBURGH'S STUFF
utilities).
If you do not wish to select a menu item, simply press the |
Page 11
ESC (escape) key. You will exit the menu and BATBOX will re- |
turn an errorlevel of 254. |
The errorlevel that is returned is affected only by the /O
switch, and NOT by whether the item is selected via the hotkey,
the item number, or the cursor bar.
The /M (master environment) switch provides an alternate |
method of communicating the menu selection. If this switch |
is used, a master environment variable named BATBOX will be |
set equal to the text of the menu item selected. For an exam- |
ple of the utility of this feature, see the enclosed batch file |
SCD.BAT. |
If you enter BATBOX alone on the command line without any
parameters, the help screen will be displayed.
Time/Date Formats |
By default, BATBOX will read country information from your |
system and format the time and date displays accordingly. You |
may override the default display settings by using the /D or /T |
switches on the command line. |
Customizing Colors
Beginning with version 2.1, BATBOX users can customize their
menu's colors by using a small text file called BATBOX.CFG.
Using the color codes from Appendix 3 of STEENBURGH'S STUFF
documentation, enter a color value into a text file for the
following items, one entry per line:
Line # Controls Valid Values
====== ======== ============
1 Menu color 1-127
2 Menu border type 1-4
3 Menu shadow pattern 1-3
4 Menu title color 1-255
5 Menu interior color 1-127
6 Menu item color 1-255
7 Hot key color 1-255
8 Cursor bar color 1-255
9 Prompt message color 1-255
10 Date/time color 1-255
See the enclosed file BATBOX.CFG for an example. The 5 pre-
defined color palettes (one default and four selectable with
the /P switch) are shown below. The registered version of BAT- |
Page 12
BOX includes the program BATCOLOR, a color configuration util- |
ity which can help you create the BATBOX.CFG file. |
PREDEFINED COLOR PALETTES
0 1 2 3 4 5 6
===== ===== ===== ===== ===== ===== =====
Menu color 79 27 78 53 112 96 32
Menu border 2 1 1 1 1 3 3
Menu shadow 2 3 2 3 2 1 1
Menu title 79 27 116 95 14 95 96
Menu interior 31 27 64 48 0 111 47
Menu item 79 27 116 53 7 111 32
Hot key 30 31 79 63 14 14 14
Cursor bar 14 49 78 95 112 14 14
Prompts 31 27 116 61 7 96 47
Date/time 113 27 124 53 7 96 47
Page 13
BOX Version 1.21
Copyright 1992 by Chuck Steenburgh & Tay-Jee Software
BOX helps to bridge a gap between the BATBOX and WRITE/INPUT
components of STEENBURGH's STUFF. People have often expressed
a desire to create "dialog boxes" from within batch files,
using a shadowed box similar to that used by BATBOX. BOX now
provides this capability of creating a box on the screen, which
can subsequently be filled with text via a WRITE or INPUT call.
Usage: BOX /Ln /Tn [/Hn /Wn /Yn /Cn /In /S[-|n] /?] |
or BOX textfile [/Cn] [/In] [/Xn] [/S-|/Sn] [/?] |
/Ln Column location for leftmost edge of
box.
/Tn Row location for topmost edge of box.
/Hn Height of box in rows.
/Wn Width of box in rows.
/Yn Style of box (one of nine styles shown
below)
/Bn Background color of box border
/Fn Foreground color of box border |
/In Interior color of box
/Xn Text display color |
/S- Disable drop shadow
/Sn Style of shadow (one of three styles
shown below)
/? Displays brief help screen
Examples:
BOX /T5 /L20
Displays a single-line box, centered on screen, with top left
corner located in row 5, column 20, in white on black.
BOX /T10 /L30 /H4 /C79 /I4 /Y2 |
Page 14
Displays a double-line box 4 rows high, centered horizontally
on the screen, located in row 10, column 30. Box is bright
white on red with a red interior.
BOX /L60 /T15 /H3 /W10 /S-
Displays a 3 row-by-10-column single-line box, with top left
corner located in row 15, column 60. Box is white on black with
no drop shadow.
BOX hello.txt /X79 |
Displays up to 20 lines of text from the file HELLO.TXT in a |
box centered on the screen. Text is bright white on red. |
The leftmost column (/Ln) must be at least 1, and no greater
than 78. The topmost row (/Tn) must be at least 1, and no
greater than 22 for a 25-line screen, 40 for a 43-line EGA |
screen, or 47 for a 50-line VGA screen. (These limits are im- |
posed to make room for a drop shadow.) The box must also be at |
least two rows "tall" (/Hn) and at least two columns "wide" |
(/Wn). |
The nine box styles are listed below:
1 - Single edge box
2 - Double edge box
3 - Double horizontal/single vertical edge box
4 - Single horizontal/double vertical edge box
5 - Thick edge box
6 - Medium edge box
7 - Shaded thick box (ASCII 176)
8 - Shaded thick box (ASCII 177)
9 - Shaded thick box (ASCII 178)
Styles 7, 8, and 9 correspond to the three shadow styles.
/S1 produces a shadow using ASCII 176, /S2 using ASCII 177,
and /S3 using ASCII 178. The default is /S2.
Use the following guide for foreground and background colors:
Value for n Foreground Background
=========== ========== ==========
0 Black Black
1 Blue Blue
2 Green Green
3 Cyan Cyan
Page 15
4 Red Red
5 Magenta Magenta
6 Brown Brown
7 White White
8 Grey Black*
9 Light blue Blue*
10 Light green Green*
11 Light cyan Cyan*
12 Light red Red*
13 Light magenta Magenta*
14 Yellow Brown*
15 Bright white White*
* indicates "blinking" foreground colors.
To calculate the color value for the /C switch, multiply the |
background value by 16 and add the foregrond value. Use the |
same values for text colors (/X). |
Additionally, n values of 0 to 7 are valid for interior
colors (/In). The box will be filled with spaces (ASCII 32)
with a background color corresponding to that of the attribute
selected from the chart above.
The following errorlevel values are returned:
0 - Normal exit, no errors
1 - Invalid left column (/Ln) |
2 - Invalid top row (/Tn) |
3 - Invalid box height (/Hn) |
4 - Invalid box width (/Wn) |
5 - Invalid box color (/Cn) |
6 - Invalid text color (/Tn) |
7 - Invalid shadow style (/Sn) |
8 - Invalid fill color (/In) |
9 - Invalid text file name |
255 - Help screen displayed/no parameters entered
Page 16
CHKDRV Version 2.0 |
Copyright 1992-1993 Chuck Steenburgh & Tay-Jee Software |
CHKDRV will report all existing, valid disk drive letters,
or check the validity of a specific drive.
Syntax:
CHKDRV [d:] [/D] [/K] [/Q] [/V] [/Xtypelist] [/H | /?]
d: Optional drive letter to check
/D Detailed errorlevel report |
/K disable drive types Key |
/Q Quiet mode (driver letters only, no key or symbols)|
/V Verify drive status (physical check) |
/Xtypelist eXclude certain types of drives. Include one or |
of the following codes in typelist: |
f - floppy drives |
h - hard drvies |
n - networked (remote) drives |
l - networked (local) drives |
d - device-driven drives |
r - RAM disks |
s - SUBSTed drives |
/H | /? brief Help screen
Used alone on the command line, CHKDRV will print a listing
of all valid disk drive letters, including "ghost" drives,
RAM disks, networked, or SUBSTed drives. CHKDRV will set the
DOS errorlevel equal to the total number of drives installed.
Unless the /Q switch is used, each drive letter will be follow- |
ed by one or more symbols indicating its characteristics. A |
key explaining these symbols appears below the dirve list unless|
disabled by the /K switch.
Normally, upper-case drive letters are used to indicate all |
fixed disks, while removable (floppy) devices are indicated by |
lower case letters. |
If an optional drive letter (with ot without colon) is spec-
Page 17
ified, CHKDRV will determine if that letter is assigned to a
valid disk drive. CHKDRV will inform you of the drive's status
via a screen message and errorlevel return. An errorlevel of
0 indicates that the specified drive exists, while an errorlevel
of 255 indicates an invalid drive. When the /D switch is used, |
a more detailed errorlevel report wil be given, indicating the |
size of the drive. |
In the event of an error, or if the /H parameter is speci-
fied, a brief help screen is displayed, and the errorlevel is
set to 254.
Errorlevel return table for /D switch:
Errorlevel Drive type:
1 5¼" (360k) |
2 5¼" (1.2M) |
3 3½" (720k) |
4 3½" (1.4M) |
5 3½" (2.8M) |
6 Floptical |
7 Fixed disk |
8 Tape drive |
9 8" drive |
19 Write protected disk (/V switch) |
21 No disk in drive (/V switch) |
31 Unformatted disk (/V switch) |
100 Unknown |
255 Does not exist |
Page 18
CHKPRN Version 1.0
Copyright 1992 by Chuck Steenburgh & Tay-Jee Software
CHKPRN will check the status of a printer attached to ports
1, 2, or 3 (LPT1-LPT3).
Usage: CHKPRN [LPTn]
LPTn Optional parameter specifying port
to check. Valid values for n: 1-3
Examples:
CHKPRN Checks status of LPT1
CHKPRN LPT3 Checks status of LPT3
CHKPRN will display a message indicating the status of the
printer. If the printer is ready, the errorlevel will be set
to 0. If the printer is not ready, a tone will sound and the
errorlevel will be set to 1.
The included file SAFEPRN.BAT will check if the printer is
ready before copying a file to it. Use SAFEPRN.BAT to print
text files from the DOS command line. The syntax for SAFEPRN
is as follows:
SAFEPRN filename LPTn:
filename Name of the file you wish to print.
LPTn Printer port destination (n=1,2, or 3)
Errorlevel report table:
Errorlevel Condition
0 Printer is ready
1 Printer not switched on
2 Printer out of paper
3 Printer not connected
4 Printer off line
5 No parallel port installed
100 Unknown printer error
Page 19
CHKSYS Version 1.0
Copyright 1993 Chuck Steenburgh & Tay-Jee Software
CHKSYS will report the installed state of several device
drivers and TSRs, as well as other useful system information.
Syntax:
CHKSYS [operation] [/E] [/H | /?]
[operation] Device driver/information to check. One or more
of the following:
ANSI - ANSI.SYS driver
APPEND - Check for installation of APPEND
ASSIGN - Check for installation of ASSIGN
DOSKEY - Check for installation of DOSKEY
EMM386 - Check for installation of EMM386.EXE
FILES - Check for FILES= setting
GRAFTABL - Check for installation of GRAFTABL
HIMEM - Check for installation of HIMEM.SYS
KEYB - Check for installation of KEYB
NLSFUNC - Check for installation of NLSFUNC
PRINT - Check for installation of PRINT
SHARE - Check for installation of SHARE
WINDOWS - Check for presence of Windows
ALL - Check for all of the above
[/E] Store installed status in an environment variable
[/H | /?] Display help screen
If a single operation is specified, CHKSYS will set the
errorlevel to 1 if the driver/TSR is currently installed, or
return a value of 0 if it is not installed. The FILES oper-
ation is an exception to this general rule; instead, it returns
an errorlevel equal to the FILES setting currently being used.
If more than one operation is specified, the errorlevel is
always set to 0.
A brief message is displayed for each operation indicating
installation status. When the /E switch is set, an environment
variable is created indicating installation status.
Page 20
When specifying operations, only the first two characters
are necessary.
Examples:
CHKSYS PRINT
Determines if resident portion of PRINT.COM (or PRINT.EXE)
is loaded.
CHKSYS DO /E
Determines if DOSKEY is installed, and sets the environment
variable DOSKEY to YES or NO depending on installed state.
Page 21
CLK 2.51 |
Copyright 1991-1993 by Chuck Steenburgh & Tay-Jee Software
DOS offers the TIME and DATE commands which allow to
display, then set, the time and date. Unfortunately,
these commands "hang up" your system in that they prompt
you for a new time and/or date when entered by themselves
on the command line. CLK allows you to display the time
and date and then immediately terminate.
Usage: CLK [/T] [/W] [/M] [/D] [/C] [/Rnn] [/Lnn] [nnn] [/E]|
or CLK "Format" [/C] [/Rnn] [/Lnn] [nnn] [/E] |
/T displays the time in 24-hour
format
/W displays three-letter abbreviation
for the day of the week
/M displays three-letter abbreviation
for the month
/D displays the date
/C centers the displayed string on the
current line.
/Rnn displays string on row nn, where nn is
a number between 0 and 24.
/Lnn displays string starting in column nn,
where nn is a number between 0 and 79.
nnn displays output in color nnn, where nnn
is a number between 0 and 255. See
Appendix 3 for color information.
/E set result to environment variable CLK |
"Format" displays special time elements as part
of a formatted string. Must be enclos-
ed in quotes. See below for details.
Examples: (assuming run at 11:45am Sunday 6 October 1991)
CLK displays the current time and date in
the form: Sun Oct 06 11:45:00 1991
Page 22
CLK /t displays time: 11:45:00
CLK /w displays day of the week: Sun
CLK /m displays month: Oct
CLK /d displays date: 06
CLK /t /m /d /w displays: 11:45:00 Sun Oct 06
CLK /c /w /t displays: 11:45:00 Sun (centered on
current line)
CLK /c /t /r10 79 displays 11:45:00 centered on line 10
in bright white on a red background
CLK "Time: 0" displays: Time: 11:45:00
CLK /t /e displays 11:45:00, sets environment |
variable CLK equal to the string |
"11:45:00" |
Command-line parameters may be entered in any order. Dif-
ferent elements of the date/time, however, will always be dis-
played in the following order: time, day of the week, month,
and date.
The format string combines text with special replaceable
parameters to produce customized output. The text, which
should be enclosed in quotes, can be a message which includes
elements of the time. Use replaceable parameters, prefixed by
the percent () sign, to represent the following data:
a Abbreviated weekday (i.e., Sun, Mon, etc.)
A Full weekday
b Abbreviated month (i.e., Jan, Feb, etc.)
B Full month
0 Day of the month (01-31)
H Hour (24-hour clock 00-23)
I Hour (12-hour clock 00-11)
j Julian date (0-366)
m Month (01-12)
M Minute (00-59)
0000 Meridian (am or pm)
S Second (00-59)
U Week of the year (00-52), Sundays first
W Week of the year (00-52), Mondays first
w Day of the week (0-6), Sunday first
Page 23
0 Date (MM/DD/YY)
0 Time (HH:MM:SS)
Year (00-99)
Y Year (0000-9999)
Z Timezone
Special note: when using CLK with a custom format string
in a batch file, you must use the double percent sign (%) when
prefixing the special replaceable parameters.
Examples:
From the command line:
CLK "The time is now: 0. You have thirty minutes."
produces the string:
The time is now: 11:45:00. You have thirty minutes.
From a batch file:
CLK "Today is %d %B, %Y."
produces the string:
Today is 06 October, 1991.
For additional options in setting elements of the time to an |
environment variable, see the program WHENISIT (also part of |
STEENBURGH's STUFF. |
Page 24
CURSOR 1.0
Copyright 1992 by Chuck Steenburgh & Tay-Jee Software
CURSOR will change the DOS cursor from an "underscore" into
a block shape and back again.
Usage: CURSOR +|-
+ Changes cursor into a block shape
- Changes cursor into an underscore
Examples:
CURSOR + Turns the cursor into a block shape
(blinking ASCII 219 character)
CURSOR - Turns the cursor into an underscore
(blinking ASCII 95 character)
CURSOR will return an errorlevel of 1 if the cursor was
changed to block shape, 0 if changed to underscore, or 2 if an
error occurred.
Page 25
DOSVER.EXE Version 1.1
Copyright 1991 by Chuck Steenburgh & Tay-Jee Software
Use this program to determine what version of DOS is currently
running on the system.
Usage: DOSVER [n.n]
[n.n] optional version to check for
Examples:
DOSVER returns an errorlevel based on
version of DOS currently loaded
DOSVER 3.3 checks to see if DOS version 3.3,
or higher, is loaded
DOSVER returns two possible errorlevels, based on whether
it is reporting the DOS version or checking for a specific
version number.
When entered without parameters, DOSVER returns an error-
level according to the chart below:
DOS Version Errorlevel Returned
=========== ===================
5.00 50
4.01 40
3.3 33
3.21 32
. .
. .
2.0 20
etc.
When entered with a version number on the command line,
DOSVER returns the following errorlevels:
Errorlevel Meaning
========== =======
2 Loaded DOS higher version
1 Loaded DOS same version
0 Loaded DOS lower version
DOSVER also prints a brief screen message stating the DOS |
version in use. |
Page 26
Page 27
INPUT v3.2 |
Copyright 1991-1993 Chuck Steenburgh & Tay-Jee Software
If you use batch files very often, you've probably acquired
a program called ASK.COM or QUERY.COM or something similar
that allows you to ask questions and receive simple responses.
Usually, this involves typing an ECHO command with your
question, followed by ASK.COM or whatever. If you do this
a lot, you will probably appreciate the fact the INPUT.EXE
will accomplish the jobs of both the ECHO and ASK commands.
Add to this the greater flexibility that INPUT.EXE offers
in presenting your prompt to the user and in receiving input,
and you'll be sold.
Usage: INPUT ["prompt"] [nnn] [Options]
"prompt" Enter the text you would like to
appear to prompt the user for
input. This can be up to 59 char-
acters and must be enclosed in
quotation marks.
nnn Enter a number representing the
color in which you want your mes-
sage to appear. You must, of
course, have a color monitor and
card. See Appendix 3.
Options:
/a|A[+|-] color Attribute selection. When the
lower-case "a" is used, input is re-
stricted to the eight "normal" color
attributes (0-7). When the upper-case
"A" is used, input is restricted to
color attributes 0-16. Including the
"+" or "-" signs after the switch will
display the available colors above or
below the prompt, respectively.
/B[+|-] fix trailing Backslash. /B+ concat-
enates a trailing backslash to the
end of the input string if not al-
ready present. /B- removes any trail-
ing backslash present.
Page 28
/C Center output. Include this switch
if you want your prompt message cen-
tered on the current line.
/D display list of available Disk drives
on current system and restrict input
to one of these letters.
/Exxxxxx Execute command. Instead of returning
errorlevel, accept text input which is
supplied to command "xxxxxx."
/F[nn] Fixed input field of length nn. INPUT
will display a fixed, editable input
field of length nn for accepting data.
Cursor arrow, insert/delete, home/end,
and TAB keys are active in this field.
If used in conjunction with the /M
switch, the current value for the en-
vironment variable (if any) is dis-
played in the field as a default.
When this switch is used, TWO color |
values may be specified. If more than|
one is used, the FIRST is the color of|
the prompt, and the second is the |
color of the input field. |
/H or /? display brief Help screen.
/I use this for a case-Insensitive error
level return. If this switch is
included on the command line, pressing
a letter a-z (lower case) will return
the same value as if the corresponding
key A-Z (upper case) were pressed.
/Kxxxx restrict Keypress. When followed by
a list of characters, INPUT will only
accept those characters, issuing a
warning tone when any other key (ex-
cept ESC) is pressed. The errorlevel
value returned will equal the ordinal
position of the selected character in
the list.
/Ln Leftmost column in which prompt should
appear.
Page 29
/Mxxxxxx receive text input and set Master en-
vironment variable xxxxxx with data
received. Defaults to variable name
of INPUT if no name is provided.
/Oxxxxx cOncatenate "xxxxxx" to end of data
entered. Valid only for string input
options /M and /F. Adds the specified
characters to the end of the value en-
tered by the user. If you must in-
clude spaces, enclose the whole switch
in quotes.
/Pd Pause 10 seconds for user input, then
default to "d" (where "d" is any char-
acter. INPUT will wait up 10 seconds
for user input. If no key is pressed
within 10 seconds, INPUT will act as
if the key specified by the key rep-
resented by the single character "d"
was pressed. Note that all other
switches (case insensitivity, yes/no
answer, etc.) remain active if time
expires and the default key is used.
INPUT adds a warning that it will de-
fault to the specified value after 10
seconds, and will display a succession
of ten dots to indicate elapsed time.
/Q Quiet mode. Suppresses the audible
alarm prompt.
/Rn Row in which prompt should appear.
/S Show keypress. Adding this switch
will cause INPUT to display the
errorlevel value returned. Use this
for quick "debugging" of your use
of INPUT
/V instead of a single keypress, causes
INPUT to read a numeric Value (con-
cluded with a carriage return) between
0 and 255 from the keyboard. Values
less than 0 will return 0 and values
greater than 255 will return 255.
/Wn when used in conjunction with the /P
Page 30
switch, changes the default Wait time
to n seconds, where n is no greater
than 999 seconds.
/X When used in conjunction with the /W
and/or /P switches will suppress dis-
play of the default value and timer
"ticks."
/Y use this for a Yes-no only response.
If the "n" key is pressed, errorlevel
of "0" is returned; pressing any other
key returns an errorlevel of 1. The
prompt "(Y/n)" is appended to the nor-
mal prompt specified by the user.
/N Use this for a yes-No only response.
If the "y" key is pressed, errorlevel
of "1" is returned; pressing any other
key returns an errorlevel of 0. The
prompt "(y/N)" is appended to the nor-
mal prompt specified by the user.
This switch takes precedence over the
/y switch.
The command line parameters may be entered in any
order, may be in any case, and may be preceded by
either the "/" or "-" character.
Examples:
INPUT "Select a number from one to 10"
This prints the text "Select on number from one to 10"
on the current line and waits for a keypress.
INPUT "Press any key to continue" 79
This prints the text "Press any key to continue" on the
current line in bright white on a red background and waits
for a keypress.
INPUT "Press the space bar to exit" 143 /c
This prints the text "Press the space bar to exit" cen-
tered on the current line in flashing bright white on a black
background.
Page 31
INPUT /s /i "Press any key..." /c 14
Prompts user with "Press any key..." in yellow on black.
Returns a case-insensitive errorlevel and displays it on the
screen before terminating.
INPUT "Do you wish to continue?" /s 79 /y
Prompts user with "Do you wish to continue? (Y/n)" in
white on red. Returns errorlevel of 1 unless the "n" key is
pressed. Displays errorlevel on screen.
INPUT "Press any key..." /pf
Prompts user with "Press any key... (defaults to f after
10 seconds)" in black on white. Returns errorlevel of 102 if
no key is pressed within 10 seconds, otherwise returns value of
key pressed.
INPUT "Press any key..." /c /pf
Prompts user with "Press any key... (defaults to f after
10 seconds)" in black on white. Returns errorlevel of 70 if no
key is pressed within 10 seconds, otherwise returns the upper
case ASCII value of the key pressed.
INPUT "Enter data:" /p1 /w15 /q 30
Prompts user with "Enter data: (defaults to 1 after 15
seconds)" in yellow on blue. Returns errorlevel of 49 if no
key is pressed after 15 seconds, otherwise returns the error-
level of the key pressed. The alarm does NOT sound.
INPUT "How many copies should be printed? " /v /c
Prompts user with "How many copies should be printed?"
centered on the current line. A number can be entered by the
user and INPUT will return an errorlevel equal to the number
entered (between 0 and 255). If the /V switch is used, the
data entered by the user will appear on screen, and can be
changed using backspace before pressing <Return>.
INPUT "Press any key to continue..." /p /x
Displays the familiar DOS PAUSE message, but exits after
a 10 second delay if no key is pressed. An errorlevel of 0 is
returned.
Page 32
INPUT "Switch to which drive?" /D
Displays prompt "Switch to which drive?" followed by a
list of all valid drives on the system. Will not exit until
one of these drive letters is pressed.
INPUT "Enter a directory mask " /Edir /C
Centers prompt "Enter a directory mask " on screen. Exe-
cutes DOS "dir" command, using any text entered in response to
prompt as arguments. For example, if user typed "*.exe /p" the
command "dir *.exe /p" will be executed by INPUT. This allows
INPUT to be used to enter limited string data.
INPUT "Enter a file name: " /MFILENAME
Accepts text data from keyboard and places value entered
in the master environment in a variable named "filename." This
value can later be accessed within a batch file or via other
programs.
INPUT "New PATH: " /MPATH /F60
Displays the current PATH setting in a fixed-length field 60
characters wide. It may then be edited and saved by pressing
ENTER.
INPUT "Select an option: " /KABC
Returns an errorlevel of 1 if A is pressed, 2 if B, and 3 if
C is pressed. Sounds a beep if any other key is pressed and
waits for valid keypress or ESC.
CD | INPUT /MDIR /Q
In this redirection example, the output of the "CD" command
is "piped" into INPUT, which stores in information in an envir-
onment variable called DIR. (The CD command entered by ltself
displays the current drive and directory name.) The output of
virtually any command can be stored in the environment using
INPUT in this manner.
INPUT will also sound an alarm to let the user know that
a response is expected (unless /Q switch specified).
When a key is pressed, INPUT will set the errorlevel equal
to the ASCII value of the key pressed. This is slightly dif-
ferent from BATBOX in that in normal operation INPUT is case
Page 33
sensitive and will allow you to distinguish between upper and
lower case letters. If you want a case-insensitive return, use
the /i switch. See Appendix 2 for a complete list of the ASCII
characters theoretically supported by INPUT. If the /H or /?
parameter was specified, the errorlevel returned will be 255.
If the ESC key is pressed, an errorlevel of 254 will be re-
turned.
When using the /E parameter to execute a batch file, be sure
to include the extension ".BAT" as part of the switch.
When using the /M switch to set an environment variable, the
variable name you supply will be converted to upper case. DOS
will only recognize upper case variables within batch files.
When using the /M switch in conjunction with /Y or /N, the
variable will be assigned a value of YES or NO as appropriate.
SPECIAL NOTE TO 4DOS* and NDOS USERS
INPUT.EXE conflicts with 4DOS' INPUT internal command. To
remedy this situation, create a batch file containing the two
lines below (or add them to your AUTOEXEC.BAT file) and execute
once each time your computer is turned on:
alias input d:\path\input.exe
alias inp4 *input
The first line creates an alias of "input" for the program
INPUT.EXE. The second line creates an alias of "inp4" for the
internal 4DOS INPUT command. Make sure the "d:\path\" part of
the first line is replaced with the actual drive/path in which
INPUT.EXE is located on your system. Since INPUT performs many
more functions than the 4DOS command, it is desirable to
avoid any confusion and simply replace 4DOS' INPUT command.
* 4DOS is a registered trademark of JP Software Inc.
Page 34
KLS 3.0 |
Copyright 1991-1994 Chuck Steenburgh & Tay-Jee Software
KLS is a simple replacement for the DOS screen-clearing
function (CLS).
Usage: KLS [color] [/Bn] [/M] [/V] [/X | /N] [/H] |
color A number from the list below:
0 - Black
1 - Blue
2 - Green
3 - Cyan
4 - Red
5 - Magenta
6 - Brown
7 - White
/Bn Change border to color n, where n:
0 - Black
1 - Blue
2 - Green
3 - Cyan
4 - Red
5 - Magenta
6 - Brown
7 - White
8 - Grey
9 - Bright blue
10 - Light green
11 - Light cyan
12 - Light red
13 - Light magenta
14 - Yellow
15 - Bright white
/H | /? Display brief help screen.
/M Report EGA/VGA memory installed. |
/N Return to normal 25-line mode.
/V Verbose report
/X Enter extended video mode (43 lines
for EGA, 50 lines for VGA).
Page 35
Examples:
KLS 4 Clears the screen & paints it red.
KLS 6 Clears the screen & paints it brown.
KLS /B4 Turns border magenta.
KLS /B1 6 Clears screen & paints it brown with
a blue border.
KLS /4 /B4 /E Clears screen, sets screen to 43- or
50-line mode, and paints screen and
border red.
KLS /N Clears screen, returning it to 25-
line mode and default color.
KLS /V /M Clears screen, reports amount of |
EGA/SVGA memory (if applicable), and |
reports findings to screen in detail. |
When the screen is cleared, it will be set to the color indi-
cated on the command line. Entering KLS without parameters
is the same as issuing CLS (i.e., clear screen without color).
"KLS 0" is useful if you have used ANSI or some other method
to set your screen to a color other than black, but you want
a black screen temporarily.
The /B switch, by itself, does NOT clear the screen. Some-
times you will want to reset the border color without erasing
what is on the screen (such as when a "misbehaved" program
changes the color of your screen border and does not reset it).
KLS also detects the type of video display card installed
and returns errorlevel codes as shown below:
0 - monochrome display adapter (MDA)
1 - color graphic adapter (CGA)
2 - extended graphics adapter (EGA)
3 - video graphics array (VGA)
4 - multi-color graphics adapter (MCGA)
5 - Hercules graphics adapter
SVGA cards:
6 - VESA-compatible SVGA card |
7 - AHEAD-A chipset |
8 - AHEAD-B chipset |
Page 36
9 - ATI 18800 chipset |
10 - ATI 18800-1 chipset |
11 - ATI 28800 chipset |
12 - C&T 82c451 chipset |
13 - C&T 82c452 chipset |
14 - C&T 82c453 chipset |
15 - Genoa 6000 chipset |
16 - Oak OTI-067 chipset |
17 - Paradise PVGA1a chipset |
18 - Paradise WD90C00 chipset |
19 - Paradise WD90C11 chipset |
20 - Trident 8800 chipset |
21 - Trident 8900 chipset |
22 - Tseng ET3000 chipset |
23 - Tseng ET4000 chipset |
24 - Video7 chipset |
25 - Cirrus Logic 54xx chipset |
26 - S3 chipset |
27 - Trident 8900B/C chipset |
When using the /V switch, a brief screen message describing
the installed video card is displayed.
When using the /M switch, the errorlevel is set too indicate |
the type of card and amount of video memory as follows: |
Errorlevel Video card & memory |
========== =================== |
41 EGA w/64k |
42 EGA w/128k |
43 EGA w/192k |
44 EGA w/256k |
51 SVGA w/512k |
52 SVGA w/1024k |
53 SVGA w/1536k |
54 SVGA w/2048k |
etc... |
If you make an error (specify an invalid color value), KLS
will sound a tone return an errorlevel of 255.
Page 37
LAUNCHER.EXE 2.61
Copyright 1991,1992 Chuck Steenburgh & Tay-Jee Software
Do some of your programs require you to load a data file
once you start the program? Are these data files located in
a different directory, or do you have to enter several cryptic
commands to get your program to load a data file? LAUNCHER is
designed to work with any program that can accept the name of
a data file on the command line. LAUNCHER will display a
menu of your data files, and then start your application with
the name of the file you select on the command line to be
loaded immediately.
LAUNCHER uses a rather novel method of automatically de-
termining the name of the application you are going to use
it with. Rather than needing a configuration file or compli-
cated command line switches, LAUNCHER reads the application
name from its own file name. Rename the LAUNCHER.EXE file
after the application you want to run, PLUS ANY ONE ADDITIONAL
CHARACTER. Put this renamed version of launcher in the same
directory as your application, and you're ready to LAUNCH!
Optionally, LAUNCHER will use a more traditional means of
of specifying the name of your application program through the
use of the /E switch described below.
Usage: NEWNAME [path:\]filespec [/B] [/Cnnn] [/E:filename]
[/F] [/H | /?] [/N] [\parms] |
NEWNAME This is the new name which you have
given to LAUNCHER.EXE, based on the
name of your application. (It is
not required for you to rename the
LAUNCHER.EXE file if you use the /E
switch).
path:\ Optional drive and/or path for data
files.
filespec This filespec designates what files
are to be displayed by LAUNCHER.
You may include a drive and/or dir-
ectory name, and wildcards (? *).
/B Write command generated to a file
named LAUNCHME.BAT rather than exec-
uting immediately. This method MUST
be used when launching batch file app-
lications.
Page 38
/Cnnn Specify color. Normally, LAUNCHER
uses a bright white on black display
scheme. Specify a color to use with
the numeric value nnn, where nnn is
between 0 and 127. See Appendix 3
color calculation.
/E:filename Optional parameter to specify the name
of your application. You may include
your application's complete path if
necessary.
/F Include only file names on command
line. Normally, LAUNCHER will in-
clude any path you have specified
on the command line string built.
Use this switch if your application
does not require the path name.
/H or /? Displays help screen.
/N Use 25-line display mode (EGA/VGA) |
\parms Enter any additional command line
parameters you would like to use with
your application program, prefaced
with a backslash. ALL parameters that
come AFTER the backslash will be pas-
sed to your application (and ignored
by LAUNCHER).
Examples:
WPI b:\wp\*.doc This will LAUNCH Word Perfect
(WP.EXE) after displaying all files
in the B:\WP subdirectory with the
extension .DOC. This assumes that
you have renamed LAUNCHER.EXE as
WPI.EXE and that this file is in the
same directory as Word Perfect.
WSI c:\ws\*.doc /f LAUNCHES WordStar (WS.EXE) from
data files in directory c:\ws\docs.
DOES NOT include the path when
LAUNCHING WordStar. (Assumes that
c:\ws is set up as your default
files directory in WSCHANGE.)
Page 39
WSI *.doc /n LAUNCHES WordStar using a data file
selected from those in the current
directory matching the filespec
*.doc. It includes the "/n" param-
eter (nondocument mode) when starting
WordStar.
WP1 *.txt /C30 LAUNCHES WordPerfect using a data
selected from those meeting file spec
*.txt. Displays menu in yellow on
a blue background.
LAUNCHER *.WKS /e:C:\123\123.BAT
Writes a batch file named LAUNCHME.BAT
which will load Lotus 1-2-3 with the
selected .WKS as a data file.
LAUNCHER *.* /e:C:\DOS\EDIT.COM \/b /h |
Writes a LAUNCHME.BAT file which will |
load the selected file into DOS' EDIT |
program, using the /b and /H switches |
for EDIT. |
After running LAUNCHER, you will see a display of files
meeting the filespec you have supplied appear on the screen.
Files will be listed alphabetically from left to right and top
to bottom. The first file will be highlighted in reverse video.
Use the four cursor movement keys (arrow keys), position the
highlight bar over the name of the file you would like loaded
into your application, then press enter. LAUNCHER will then
build a command line which includes the file just selected. If
you press the ESC key instead of enter, your application will
be started WITHOUT a data file. If no files were found that
matched the filespec, LAUNCHER will terminate without loading
the application and set the DOS errorlevel to 1.
Some programs that require very large amounts of memory,
such as Quattro Pro by Borland, will not work properly when
LAUNCHED. If at all possible, when using LAUNCHER, configure
your applications so that they use as little memory as pos-
sible. Most word processing programs do not need special con-
figuration, as they can run in 512K or less of memory. The
reason for this limitation is that LAUNCHER remains in memory
when your application is LAUNCHED, taking up about 30k of
memory. Use of the /B switch makes it possible for much larger
Page 40
programs to be LAUNCHED.
Version 2.6 now correctly runs batch file applications. To
ensure proper performance, you should only run batch file app-
lications using both the /E and /B switches. See the demo file
SAMPLE.BAT for an example of how to "automatically" LAUNCH pro-
grams using the /B switch.
Page 41
MUSIC.EXE 2.01
Copyright 1991 by Chuck Steenburgh & Tay-Jee Software
For some time now I have wanted an inexpensive way to
play short tunes on my PC. While there are many music pro-
grams available, they usually require expensive hardware,
large memory overhead, too much musical knowledge, or custom-
made musical files that you had to buy from somebody. Des-
perate, I finally decided to write my own program!
Usage: MUSIC [file[.CM1]] [/d] [/r] [/s] [/v] |
file The name of a music file with
extension .CM1 which contains
the transcribed music to be
played. Extension is optional.
/d Optional parameter specifying
"debug" mode. The line number
of each note in the .CM1 file
will be displayed as it is
played. This is useful in lo-
cating errors in the music file.
/r When used alone on the command line,
indicates random play mode. MUSIC
will search the current directory for
all music files present, and will
select one to be played at random.
/s Singalong mode. Displays musical |
scale and "bouncing note" in time |
with music. For files with lyrics, |
the words will be displayed in time |
with the music also. Cannot be used |
in conjunction with /v switch. |
/v Vidoe display mode. Shows flashing |
musical notes randomly scattered |
across the screen, in time with the |
music. Cannot be used in conjunction |
with the /s switch. |
Examples:
MUSIC dixie2.cm1 Plays the song "Dixie" encoded
in the file DIXIE2.CM1 (this
file included with the STUFF).
Page 42
MUSIC dixie2 /d Plays "Dixie" and displays the
line number of each note as it
is played.
MUSIC /r Plays at random one of the music
files in the current directory.
MUSIC /r /s Plays a random song, displaying |
musical scale and lyrics. |
When MUSIC is entered alone on the command line with no
parameters, a brief help screen is displayed.
MUSIC returns errorlevel values as shown below:
0 Normal termination
1 Invalid music file
2 Other error (invalid note, no files present, help)
3 No .CM1 files found (with /r switch) |
4 /S and /V switches used together |
For information on how to create your own music files, see
Appendix 4 and use the sample files as a guide.
Page 43
RAND 2.0
Copyright 1991-1993 Chuck Steenburgh & Tay-Jee Software
RAND provides simple random number generating capabilities
for batch files. RAND returns a random number in the form of
the DOS errorlevel, which you can then evaluate in your batch
files.
Usage: RAND [max value] | [/f]
max value Upper limit of random number range.
RAND will generate an errorlevel
between 1 and this number. The de-
fault is 100. The maximum is 255.
/f Rand will generate a unique file name |
and display it. This name can be re- |
directed via DOS as input to another |
command or program. |
Examples:
RAND Generates a random errorlevel be-
tween 1-100.
RAND 10 Generates a random errorlevel be-
tween 1-10.
RAND /F Generates a unique file name |
If the max value specified is greater than 255 or less than
1, RAND sets the errorlevel to 0.
SIFT Version 1.0
Page 44
Copyright 1993 Chuck Steenburgh & Tay-Jee Software
The three filters that come with DOS, MORE, FIND, and SORT,
are indispensable batch file programming tools. Unfortunately,
as useful as they are, they are still fairly limited in what
they can do. SIFT is a multi-purpose DOS filter that greatly
expands on the capabilities of FIND.
Syntax:
SIFT [options] < source
source | SIFT [options]\n");
[options] one or more of the following:\n");
/a Non-numeric output only. Strips all
numbers from output.
/b Backwards (reverse) output. Reverses
each line of filtered text.
/c Display occurence of find only (iden-
tical to FIND).
/d Numeric output only. Strips all non-
numeric characters from output.
/e[nnn] Convert to non-graphic characters.
SIFT will normally substitute the "*"
(ASCII 42) character unless an alter-
nate ASCII value is specified as nnn.
/fxxxxxx Output (find) lines containing string
xxxxxx only.
/i case-insensitive find (/f or /v)
(identical to FIND).
/l convert output to lowercase
/n display line numbers of output (iden-
tical to FIND).
/pnn inverse truncate after nn characters
(print output, skipping first nn char-
acters).
Page 45
/r display number of occurence of output
(relative position of find)
/tnn truncate output to nn characters
/u convert output to uppercase
/vxxxxxx display lines NOT containing string
xxxxxx
/2 Two-column output. Successive lines
of less than 40 characters are com-
bined on the same output line.
/h or /? Display help screen
SIFT is essentially a superset of the FIND filter, providing
many more functions. It uses the basic syntax of the FIND com-
mand.
Examples:
PATH | SIFT /P5
Displays the PATH setting, excluding the first 5 characters
(i.e., "PATH=").
SIFT /FTay-Jee /I /D < PHONE.LST
Searches the file PHONE.LST for the string "Tay-Jee" (any
case) and outputs all NUMERIC values on that line. Useful,
for example, in finding/displaying phone numbers or other
values.
Page 46
SKIP.EXE
Copyright 1991 by Chuck Steenburgh & Tay-Jee Software
ECHO does not permit you to enter blank lines in batch
files. While there are various tricks to accomplish this,
and a number of small .COM programs to accomplish this task,
you must still enter a separate command for each blank line.
Usage: SKIP [lines]
lines The number of lines you would like
to skip; the default is one.
Examples:
SKIP Skips a single line
SKIP 5 Skips five lines.
SKIP sets the errorlevel equal to the number of lines skipped.
Page 47
SOUNDER.EXE 3.1 |
Copyright 1991-1993 Chuck Steenburgh & Tay-Jee Software |
SOUNDER is an advanced replacement for any number of util-
ities (with names like BEEP.COM or MUSIC.COM). Most of these
programs make a simple noise or maybe play a short melody.
Most restrict you to the same monotonous tones over and over
again. SOUNDER presents you with a virtually unlimited range
of options which you can control, with ZILLIONS (up to 10 to
the 400th power!) of possible tone sequences.
Usage: SOUNDER [note] [dur] or
SOUNDER [/Ln] [/Rn] [/Tn [+] or
SOUNDER [/En] [/F] |
note A musical note (A,B,C,D,E,F,G).
dur Duration of tone or note in seconds. |
Must be a whole number between 1-9. |
/Ln Base length for random play. Spec-
ify the base length of the series of
random tones desired in tenths of a
second, where "n" is the desired tone
length. 0 < n <= 300.
/Rn Repeat random tone sequences "n" num-
ber of times. 0 < n <= 20.
/Tn Specify range of random number of
tones. 1 to n random tones will be
generated per cycle. 0 < n <= 10.
+ Make number of tones specified by /T
switch absolute.
/En Use special sound effect number n, |
where n is one the following four |
types of sound effects: |
1 - increasing pitch |
2 - decreasing pitch |
3 - up-down wail |
4 - down-up wail |
/F Use in conjunction with /E on very |
fast PCs to slow down the sounds. |
Page 48
The default is for SOUNDER to generate 1-3 random tones with
an overall tone length of approximately 2/3 second.
Examples:
sounder Produces 1-3 random tones for a total
length of approximately 2/3 second.
sounder C 2 Produces a 'C' note for two seconds.
sounder /T5 Produces 1-5 random tones for a total
length of approximately 2/3 second.
sounder /T5 /L20 Produces 1-5 random tones for a total
length of 2 seconds.
sounder /T5 /L20 + Produces 5 random tones with a length
of 0.4 second each.
sounder /T10 /R3 Produces 3 separate sequences of 1-10
random tones, each of approximately
2/3 second length.
sounder /T10 /R10 + Produces 100 random tones lasting a
total of approximately 6.7 seconds.
sounder /E1 Produces increasing pitch sound. |
sounder /E3 /F Produces up-down wailing sound on a |
very fast computer (386 or better). |
SOUNDER returns the following errorlevel codes:
0 Musical note sounded
1-10 Number of random tones sounded (last cycle only)
255 Error in note specification/help screen requested |
Page 49
SPACE Version 1.11
Copyright 1992-1993 by Chuck Steenburgh & Tay-Jee Software
SPACE combines the functions of the old utilities FREEDISK
and HOWMUCH. Use SPACE to:
- report the amount of free and total space available on
a disk
- report the total size of a group of files
- check to see if there is enough space for a group of
files on a particular disk
Usage: SPACE [filespec] [d:] [/sk | /sb] [/c] [/h | /?]
filespec Specification (including path if de-
sired) of group of files whose size
you want to report.
d: Target disk drive
/sk Report size in kilobytes (screen re-
ports only)
/sb Report size in bytes (screen reports
only)
/c Center screen output lines
/h or /? Display help screen
Examples:
SPACE *.* Reports the size (in megabytes) of all
files in the current directory.
SPACE C: /sb Reports the amount of total and avail-
able disk space (in kilobytes) on
drive C.
SPACE *.exe b: /sb Reports the size (in bytes) of all .EXE
files in the current directory; the to-
tal and available space on drive B; and
the amount of space on drive B needed
to hold the specified files.
Page 50
The default is to display all file and space sizes in mega-
bytes.
SPACE is most useful in automating file copying tasks. If
you are using a RAM disk to copy program files and overlays
to for faster execution, use SPACE to make sure there is
sufficient room on the disk before copying. The batch file
SAFECOPY.BAT uses the DOS XCOPY command to safely copy files
to a new disk, making sure enough room is available.
DOS allocates disk space in fixed units known as "clusters"
whose size is dependent upon the version of DOS used and the
size and type of the disk. For example, most floppy disks use
a cluster size of 1,024 bytes (1 kilobyte). A file that is only
100 bytes long will still occupy 1,024 bytes of space (1 full
cluster) on a floppy disk. A file that is 1,025 bytes long will
occupy TWO 1,024-byte clusters. This unused space at the end
of a file is known as "slack space." When both a filespec and
a target drive are specified for SPACE, the actual amount of
space needed by the specified files on the target drive will
be displayed, as well as the percentage of slack space.
SPACE returns one of three distinct errorlevel ranges, de-
pending on what combination of switches was chosen. If only
a filespec was included on the command line, the errorlevel is
set equal to the total size of the specified files, in 10k
increments. If only a target drive was specified, the amount
of free space (again in 10k increments) is returned via the
errorlevel. Finally, if both a filespec and a target drive
are specified, an errorlevel of 1 indicates that not enough
disk space is available, whereas an errorlevel of 0 indicates
sufficient space is available. An errorlevel of 255 indicates
that the help screen was displayed or an error condition. An
errorlevel of 254 indicates an overflow (i.e., files total
more than 2.53 megabytes or more than 2.53 megabytes are
available on the target drive).
Page 51
WAITFOR.EXE
Copyright 1991 by Chuck Steenburgh & Tay-Jee Software
Did you ever notice that if you want a batch file to wait
for you, you have to use PAUSE? This requires you to press
a key. This may not be convenient at the moment, such as
when you're talking on two phones at once and your batch file
is patiently waiting for you to tell it to print those files
your boss is impatient for. WAITFOR will simply cause your
batch file to suspend operation for a designated number of sec-
onds and then resume.
Usage: WAITFOR seconds
seconds Integer representing the number
of seconds you would like to
pause.
WAITFOR sets the errorlevel equal to the number of seconds
paused.
Page 52
WHENISIT 2.0 |
Copyright 1991-1993 by Chuck Steenburgh & Tay-Jee Software
WHENISIT is a highly flexible utility to provide control in
DOS batch files based on time and date. With its many op-
tions, WHENISIT will allow your batch files to determine the
year, month, date, day of the week, hour, minute, second, or
whether it is morning or afternoon and make intelligent de-
cisions based on this information. WHENISIT is also able to
perform actions once a day (such as at the first boot-up of the
day).
For example, you may want certain actions performed at
boot time on certain days of the week or month. Adding
WHENISIT to your AUTOEXEC.BAT file can allow you to make
these sort of decisions. (Or allow your computer to make them
for you automatically.)
Usage:
WHENISIT [option] [/Evarname] |
or |
WHENISIT [hh:mm] | [dd/mm/yy] |
where [option] is one of the following:
/? Displays help screen
/a Returns errorlevel based on am or pm.
/d Returns errorlevel equal to date.
/h Returns errorlevel equal to the hour
(24-hour clock).
/m Returns errorlevel equal to month.
/mi Returns errorlevel equal to minute.
/s Returns errorlevel equal to second.
/w Returns errorlevel based on the day
of the week.
/y Returns errorlevel equal to the last
two digits of the year.
/Evarname Set environment variable "varname" |
Page 53
with results of date/time check. |
hh:mm 24-hour time.
mm/dd/yy Date.
Entering the time in the form hh:mm will check to see if
the current time is equal to, before, or after the time entered.
If the current time is later than the time entered, an error-
level of 2 is returned. If the current time is entered, an
errorlevel of 1 is returned. If the time entered is later than
the current time, an errorlevel of 0 is returned. Entering the
date in the form mm/dd/yy will check the current date against
the value entered, and return an errorlevel as described above.
Entering WHENISIT alone on the command line will generate an
errorlevel of 1 if WHENISIT has not been executed yet that day.
Otherwise, an errorlevel of 0 will be returned. Note that if
you maintain multiple copies of WHENISIT.EXE on your system,
each copy of WHENISIT will keep track of whether or not it has
run separately from any other copies. Be sure you know which
copy you are executing! This is useful to put in AUTOEXEC.BAT
to indicate actions you want performed only ONCE each day, no
matter how many times you re-boot your computer. (Once-a-day
mode)
Examples:
WHENISIT /a Returns errorlevel of 2 if it is pm,
or 1 if it is am.
WHENISIT /y If your clock is set to the year
1991, returns an errorlevel of 91.
WHENISIT /w If your clock indicates that it is
Tuesday, returns an errorlevel of 3.
WHENISIT 12/25/91 If current date is AFTER 12/25/91,
returns errorlevel of 2. If current
date is 12/25/91, returns errorlevel
of 1. If current date is earlier
than 12/25/91, errorlevel of 0 is
returned.
WHENISIT Returns errorlevel of 0 if WHENISIT
has already executed, 1 if not.
WHENISIT /w /ETODAY Sets the variable TODAY equal to the |
Page 54
day of the week, and returns an appro-|
priate errorlevel value. |
Errorlevel Chart:
Errorlevel Switch: /a /m /w |
---------- --------------------------------------
1 AM January Sunday
2 PM February Monday
3 na March Tuesday
4 na April Wednesday
5 na May Thursday
6 na June Friday
7 na July Saturday
8 na August na
9 na September na
10 na October na
11 na November na
12 na December na
The errorlevels returned through the use of other switches
should be self-explanatory.
The following errorlevel values indicate a syntax error: |
Errorlevel Error |
========== ===== |
250 Invalid day (within entered date) |
251 Invalid month (within entered date) |
252 Invalid year (within entered date) |
253 Invalid minute (within entered time) |
254 Invalid hour (within entered time) |
255 Too many arguments on command line |
Page 55
WRITE.EXE 2.5
Copyright 1991-1993 Chuck Steenburgh & Tay-Jee Software
We know that ECHO has its limits, don't we? WRITE will let
you have full control over the positioning and color of your
text messages in batch files. Version 2.0 adds the capability
to have write display text files, similar to DOS's TYPE|MORE
combination, but in FULL color that you specify.
Syntax:
WRITE "Text"|@file [ccc] [/C] [/Rn] [/Ln] [/S] [/X|/N] [/H]|
"Text" This is the text to be displayed,
which must be enclosed in quotes if
it consists of more than one word.
@file Name of file containing ASCII text to
be displayed. Can be specified in
lieu of "Text."
ccc This is the color in which to print
the text. See Appendix 3.
/C Centers text on line.
/Rn n is the row (0-24, top to bottom) on
which the text will appear. The de-
fault is to use the current cursor
position.
/Ln n is the column (0-79, left to right)
where the text will begin printing.
The default is to use the current cur-
sor position.
/S Include this switch to utilize slow
(BIOS) screen writes. This will
suppress "snow" on some CGA displays.
/X | /N Places screen in eXtended (43/50 line)|
mode or Normal (25 line) mode on EGA |
or VGA systems. |
/H Displays brief help screen.
Examples:
Page 56
WRITE "This is my message"
Displays "This is my message" on the current line in gray
on black background (same as ECHO This is my message, only
MUCH faster).
WRITE "This is my message." 79
Displays "This is my message." on the current line in
bright white on red background.
WRITE "Hello, Chuck." /r10 /l25
Displays "Hello, Chuck." on row 10, column 25, in gray on
black background.
WRITE "Goodbye, Chuck." /r5 /c /s 207
Displays "Goodbye, Chuck." centered on row 5 in flashing
bright white on red background. Suppresses snow on old CGA sys-
tems.
WRITE @write.doc 15
Displays this documentation file on the screen in bright
white on black background.
If a text file is to be displayed, the /L, /R, and /C switch-|
es are ignored. The screen will be cleared, and text will be |
displayed a screen at a time. Users will be prompted with the |
familiar "Press any key to continue..." message to continue on |
to the next screen. |
WRITE returns errorlevels as follows:
0 Normal termination
1 Text file displayed
2 Help screen displayed
Note to users of WRITE 1.1 or 1.0:
Commands written for earlier versions of WRITE are not com-
patible with WRITE 2.x. Sorry, but the new features included
with WRITE 2.0 demanded a different system of passing parameters
to the program. The current switches are similar to those used
with the remainder of STEENBURGH'S STUFF utilities. The original
two releases of WRITE were little more than executable versions
Page 57
of some "C" functions I had written for use in other programs,
while version 2.0 is a completely new, much more flexible and
capable utility.
Page 58
XD Version 2.2 |
Copyright 1991-1993 Chuck Steenburgh & Tay-Jee Software
XD is included as a directory creation/changing utility.
There are better ones available, I suggest you get one if
you can. XD does offer advantages over the cd and md commands
found in DOS.
Usage: XD [drive:][\directory]...
drive: Drive letter (with colon) that you
want to switch to.
\directory Directory (with slash) that you want
to change to. If it does not exist,
XD will create it and then move you
there.
Examples:
XD D:\DOS Changes to drive D: (if necessary)
then changes to the \DOS directory,
creating it if necessary.
XD QPRO\DATA Changes to subdirectory QPRO, then
to subdirectory DATA, creating it
if necessary.
If you are using XD to create a new directory, you may only
create one new level. For example, if you issue the command
"XD C:\DOS\UTILITY" and that directory does not exist, XD will
create IF C:\DOS already exists.
XD sets the errorlevel to 1 if the above condition is en-
countered and it is unable to create a new directory. XD also
will set the errorlevel to 2 if the specified drive does not
exist. Either error condition also results in the sounding of
a tone.
Entering XD without any parameters will cause a dialog box
to appear on screen. Enter the desired drive and/or directory
in the dialog box and press <Enter>.
If a trailing backslash is included in the path name, it |
will be removed befroe further processing. |
Page 59